#include "StdAfx.h"
#include "AIModuleWrapper.hpp"

#pragma unmanaged

namespace BWAPI {
	Game *Broodwar;
}

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) {
	switch (dwReason) {
		case DLL_PROCESS_ATTACH:
		  BWAPI::BWAPI_init();
			break;
			
		case DLL_PROCESS_DETACH:
			break;
	}
	return TRUE;
}

#pragma managed

extern "C" __declspec(dllexport) BWAPI::AIModule *newAIModule(
		BWAPI::Game *Game) {
		
  BWAPI::Broodwar = Game;
  
  return new AIModuleWrapper(Game);
}
